import Vue from 'vue'
import VueRouter from 'vue-router'
import Zhuye from '@/views/zhuye.vue'
import ZhuYe1 from '@/views/zhuye/zhuye1.vue'
import BoWen from '@/views/zhuye/bowen.vue'
import BwDetail from '@/views/detail.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '',
    component: Zhuye,
    redirect: '/',
    children: [
      {
        path: '/',
        component: ZhuYe1,
        meta: { title: '太狼 | 首页' }
      },
      {
        path: '/bowen',
        component: BoWen,
        meta: { title: '太狼 | 博文列表' }
      }]
  },
  {
    path: '/detail/:bowenid',
    name: 'detail',
    component: BwDetail,
    meta: { title: '太狼 | 博文详细' }
  }
]

const router = new VueRouter({
  routes,
  mode: 'history'
})

export default router
